using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;

namespace ETUDataControls
{
    public class DataBridgeConnector 
    {
        private ETUSQLDataLayer gdlSQL = new ETUSQLDataLayer();
        private string connectionString;

        public DataBridgeConnector(string connect)
        {
            connectionString = connect;
        }

        public object[] ExecuteSQLNonQueryWithOutput(string connectNewString, string spName, params object[] parameterValues)
        {
            gdlSQL.ConnectString = connectionString;
            object[] objScale = gdlSQL.ExecuteSQLNonQueryWithOutput(connectNewString, spName, parameterValues);
            return objScale;
        }

        public object[] ExecuteSQLNonQueryWithOutput(string spName, params object[] parameterValues)
        {
            object[] objScale = gdlSQL.ExecuteSQLNonQueryWithOutput(spName, parameterValues);
            return objScale;
        }
        public SqlDataReader GetSqlDataReader(string connectNewString, string spName, params object[] parameterValues)
        {
            SqlDataReader odr = gdlSQL.ExecuteReader(connectNewString, spName, parameterValues);
            return odr;
        }

        public SqlDataReader GetSqlDataReader(string spName, params object[] parameterValues)
        {
            gdlSQL.ConnectString = connectionString;
            SqlDataReader odr = gdlSQL.ExecuteReader(spName, parameterValues);
            return odr;
        }

        public int ExecuteSqlNonQuery(string connectNewString, string spName, bool nonReturnValue, params object[] parameterValues)
        {
            int i = gdlSQL.ExecuteNonQuery(connectNewString, spName, nonReturnValue, parameterValues);
            return i;
        }

        public int ExecuteSqlNonQuery(string spName, bool nonReturnValue, params object[] parameterValues)
        {
            gdlSQL.ConnectString = connectionString;
            int i = gdlSQL.ExecuteNonQuery(spName, nonReturnValue, parameterValues);
            return i;
        }

        public DataSet GetSqlDataSet(string connectNewString, string spName, params object[] parameterValues)
        {
            DataSet ds = gdlSQL.ExecuteDataSet(connectNewString, spName, parameterValues);
            return ds;
        }

        public DataSet GetSqlDataSet(string spName, params object[] parameterValues)
        {
            gdlSQL.ConnectString = connectionString;
            DataSet ds = gdlSQL.ExecuteDataSet(spName, parameterValues);
            return ds;
        }
        public DataTable GetTable(string rawSQLQuery)
        {
            gdlSQL.ConnectString = connectionString;
            DataTable dt = gdlSQL.GetTable(rawSQLQuery);
            return dt;
        }
        public DataTable GetTable(string connectString, string rawSQLQuery)
        {
            DataTable dt = gdlSQL.GetTable(connectString,rawSQLQuery);
            return dt;
        }
        public void ServeSQLStatements(string rawSQLQuery)
        {
            gdlSQL.ConnectString = connectionString;
            gdlSQL.ServeSQLStatements(rawSQLQuery);
           
        }
        public DataTable GetSqlDataSet(string connectNewString, string rawSQLQuery)
        {
            DataTable dt = gdlSQL.GetTable(connectNewString, rawSQLQuery);
            return dt;
        }


       
        
        
    }
}
